<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<%@ include file="/include/include.jsp" %>
<style type="text/css">

</style>
<script type="text/javascript" >

	function validate(){
	  var flag=true;  
	  var startDate= document.getElementById("startDate").value ;
	  var endDate=document.getElementById("endDate").value;
	  if(startDate > endDate){
	  	flag=false;
	  	alert("开始日期不能大于结束日期！");
	  }
	  return flag;	
	}
	
</script>
</head>

<body >
	
	<%@ include file="/include/header.jsp" %>

	<%@ include file="/include/menu.jsp" %>
	
	<%@ include file="/include/context.jsp" %>
			
	<div id="mainContent">
		<h2><a href="${ctx}/${menu.url}">${menu.description}</a>&nbsp;-&nbsp;<a href="${ctx}/${empty currViewBarSubMenu_ ? submenu.url : currViewBarSubMenu_.url}">${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}</a></h2>
		<div class="tool-bar">
			<form method="post" action="${ctx}/purchase/placespread/search/do" onsubmit="return validate();">		
			<div><input id="chaxunId" type="submit" value="查询"></input></div>		
			<div>结束日期<input id="endDate" name="endDate" class="Wdate" type="text" onclick="WdatePicker({skin:'whyGreen'})" value="${endDate}"/></div>
			<div>开始日期<input id="startDate" name="startDate" class="Wdate" type="text" onclick="WdatePicker({skin:'whyGreen'})" value="${startDate}"/></div>
		    </form>
		</div>
		<div class="sarch-bar" id="searchDiv">
		</div>
		
		<div class="grid-list">
			<table class="grid" cellspacing="0">
				<thead>
					<tr>
						<td>开始日期</td>
						<td>结束时间</td>
						<td>签到位置企业信息</td>
						<td>姓名</td>
						<c:forEach var="po" items="${userinfos}">
						<td>${po.userName}</td>
						</c:forEach>
					</tr>
				</thead>
				<tbody>
					<tr>
					 		<td></td>
							<td></td>
							<td></td>
							<td>部门</td>
							<c:forEach var="dp" items="${departList}">
							<td>${dp.departname}</td>
							</c:forEach>
					 </tr>
					 <tr>
					 		<td></td>
							<td></td>
							<td></td>
							<td>有效签到次数</td>
							<c:forEach var="ef" items="${effcountList}">
							<td>
							<c:if test="${ef!=0}">
					 					${ef}
					 				</c:if>
					 				<c:if test="${ef==0}">
					 				</c:if>
							</td>
							</c:forEach>
					 </tr>
					 <c:forEach var="vo" items="${list}" varStatus="status">
					 	<tr>
					 		<td>${vo.startDate}</td>
							<td>${vo.endDate}</td>
							<td>${vo.companyName}</td>
							<td></td>
					 		<c:forEach var="count" items="${vo.countList}">
					 			<td>
					 				<c:if test="${count!=0}">
					 					${count}
					 				</c:if>
					 				<c:if test="${count==0}">
					 				</c:if>
					 			</td>
					 		</c:forEach>
					 	</tr>
					 </c:forEach>
				</tbody>
			</table>
			<t:page action="${ctx}/purchase/placespread/list"></t:page>
		</div>
	</div>
	
	<%@ include file="/include/script.jsp" %>

</body>

</html> 